<?php
class SF_AttrBindCategory_Block_Adminhtml_List_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form
{
	protected function _prepareForm()
	{
		$form = new Varien_Data_Form();
		$this->setForm($form);
		$fieldset = $form->addFieldset('attrbindcategory_form', array('legend'=>$this->__('Item information')));

		$fieldset->addField('id', 'label', array(
		'label'     => $this->__('Id'),  
		)); 

		$fieldset->addField('category_id', 'select', array(
			'label'     => $this->__('Category'),
			'required'  => true,
			'name'      => 'category_id',
			'values'    => Mage::getModel('attrbindcategory/source_category')->toOptionArray(),
		));
		
		$fieldset->addField('attributeset_id', 'select', array(
			'label'     => $this->__('Attribute Set'),
			'required'  => true,
			'name'      => 'attributeset_id',
			'values'    => Mage::getModel('attrbindcategory/source_set')->getAllOptions(),
		));
		

		if ( Mage::getSingleton('adminhtml/session')->getattrbindcategoryData() )
		{
			$form->setValues(Mage::getSingleton('adminhtml/session')->getattrbindcategoryData());
			Mage::getSingleton('adminhtml/session')->setattrbindcategoryData(null);
		} elseif ( Mage::registry('attrbindcategory_data') ) {
			$form->setValues(Mage::registry('attrbindcategory_data')->getData());
		}
		return parent::_prepareForm();
	}
}

